package com.centaline.androidsalesblog.api.usercenter;

import com.android.volley.DefaultRetryPolicy;
import com.android.volley.Request;
import com.android.volley.RetryPolicy;
import com.centaline.androidsalesblog.api.UserCenterApi;
import com.centaline.androidsalesblog.constants.AppConstant;
import com.centaline.androidsalesblog.model.responseobject.UserCenterRo;
import com.centanet.framework.interfaces.IResponseListener;

/**
 * 更新用户头像
 * Created by Lihq on 2016/1/18.
 */
public class UpdateUserImgApi extends UserCenterApi<UserCenterRo> {

    private String img;

    public UpdateUserImgApi(Class<?> tag, Class<UserCenterRo> aClass, IResponseListener<UserCenterRo> iResponseListener) {
        super(tag, aClass, iResponseListener);
    }

    public void setImg(String img) {
        this.img = img;
    }

    @Override
    public int getMethod() {
        return Request.Method.POST;
    }

    @Override
    public void setParams() {
        putParams("UserId", AppConstant.UserId);
        putParams("Img", img);
    }


    @Override
    public String getPath() {
        return "UpdateUserImgRequest";
    }

    @Override
    protected RetryPolicy getRetryPolicy() {
        return new DefaultRetryPolicy(10000, 1, 1.0f);
    }
}

